package main

func findIntersectionValues(nums1 []int, nums2 []int) []int {
	m1 := make(map[int]int)
	for _, v := range nums1 {
		m1[v]++
	}
	m2 := make(map[int]int)
	for _, v := range nums2 {
		m2[v]++
	}
	ans1 := 0
	for _, v := range nums1 {
		if _, ok := m2[v]; ok {
			ans1++
		}
	}
	ans2 := 0
	for _, v := range nums2 {
		if _, ok := m1[v]; ok {
			ans2++
		}
	}
	return []int{ans1, ans2}
}